﻿using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Media;

namespace 刷屏测试软件.ViewModel
{
    public class TestViewModel : Notify
    {
        int _AllCount;
        public int AllCount
        {
            get { return _AllCount; }
            set { _AllCount = value; RaisePropertyChanged("AllCount"); }
        }
        int _WaitCount;
        public int WaitCount
        {
            get { return _WaitCount; }
            set { _WaitCount = value; RaisePropertyChanged("WaitCount"); }
        }
        int _IngCount;
        public int IngCount
        {
            get { return _IngCount; }
            set { _IngCount = value; RaisePropertyChanged("IngCount"); }
        }
        int _PassCount;
        public int PassCount
        {
            get { return _PassCount; }
            set { _PassCount = value; RaisePropertyChanged("PassCount"); }
        }
        int _FailCount;
        public int FailCount
        {
            get { return _FailCount; }
            set { _FailCount = value; RaisePropertyChanged("FailCount"); }
        }
        private ObservableCollection<Item> _MacItems = new ObservableCollection<Item>() { };
        public ObservableCollection<Item> MacItems
        {
            get => _MacItems;
            set { _MacItems = value; RaisePropertyChanged("MacItems"); }
        }
        public class Item : Notify
        {
            string _Mac;

            public string Mac
            {
                get { return _Mac; }
                set { _Mac = value; }
            }
            string _dBm;

            public string dBm
            {
                get { return _dBm; }
                set { _dBm = value; }
            }
            int _id;
            public int id
            {
                get { return _id; }
                set { _id = value; }
            }

            string _Battery;

            public string Battery
            {
                get { return _Battery; }
                set { _Battery = value; }
            }

            string _Ver;

            public string Ver
            {
                get { return _Ver; }
                set { _Ver = value; }
            }

            bool _IsCheck;

            public bool IsCheck
            {
                get { return _IsCheck; }
                set { _IsCheck = value; RaisePropertyChanged("IsCheck"); }
            }
            double _ItemHeight = 40;
            public double ItemHeight
            {
                get { return _ItemHeight; }
                set { _ItemHeight = value; RaisePropertyChanged("ItemHeight"); }
            }
            string _RefreshResult;

            public string RefreshResult
            {
                get { return _RefreshResult; }
                set { _RefreshResult = value; RaisePropertyChanged("RefreshResult"); }
            }

            string _LightResult;

            public string LightResult
            {
                get { return _LightResult; }
                set { _LightResult = value; RaisePropertyChanged("LightResult"); }
            }
            SolidColorBrush _BackColor = Brushes.LightGray;
            public SolidColorBrush BackColor
            {
                get { return _BackColor; }
                set { _BackColor = value; RaisePropertyChanged("BackColor"); }
            }
            DateTime _time = DateTime.Now;
            public DateTime time
            {
                get { return _time; }
                set { _time = value; }
            }
        }
        public class Notify : INotifyPropertyChanged
        {
            public event PropertyChangedEventHandler PropertyChanged;
            protected virtual void RaisePropertyChanged(string propertyname)
            {
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));
            }
        }
    }
}
